﻿using Ewell.BizComponent.UI.Core.VievModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ewell.BizComponent.UI.OutSetl.ViewModel
{
    /// <summary>
    /// 处方
    /// </summary>
    public class PrescriptionVm:ViewModelBase
    {
        /// <summary>
        /// 处方标识
        /// </summary>
        private string _presId;
        public string presId 
        {
            get => _presId;
            set
            {
                if(_presId != value)
                {
                    _presId= value;
                    OnPropertyChanged(nameof(presId));
                }
            }
        }
        /**
         * 药品标志
         */
        private string _drugFlag;
        public string drugFlag
        {
            get => _drugFlag;
            set
            {
                if (_drugFlag != value)
                {
                    _drugFlag = value;
                    OnPropertyChanged(nameof(drugFlag));
                }
            }
        }
        /**
         * 处方类型代码
         */
        private string _presTypeCoding;
        public string presTypeCoding
        {
            get => _presTypeCoding;
            set
            {
                if (_presTypeCoding != value)
                {
                    _presTypeCoding = value;
                    OnPropertyChanged(nameof(presTypeCoding));
                }
            }
        }
        /**
         * 处方类型名称
         */
        private string _presTypeName;
        public string presTypeName
        {
            get => _presTypeName;
            set
            {
                if (_presTypeName != value)
                {
                    _presTypeName = value;
                    OnPropertyChanged(nameof(presTypeName));
                }
            }
        }
        /**
         * 处方明细条数
         */
        private int? _presDetailCount;
        public int? presDetailCount
        {
            get => _presDetailCount;
            set
            {
                if (_presDetailCount != value)
                {
                    _presDetailCount = value;
                    OnPropertyChanged(nameof(presDetailCount));
                }
            }
        }
        /**
         * 处方流水号
         */
        private string _presNo;
        public string presNo
        {
            get => _presNo;
            set
            {
                if (_presNo != value)
                {
                    _presNo = value;
                    OnPropertyChanged(nameof(presNo));
                }
            }
        }
        /**
         * 草药付数
         */
        private int? _herbalTieCount;
        public int? herbalTieCount
        {
            get => _herbalTieCount;
            set
            {
                if (_herbalTieCount != value)
                {
                    _herbalTieCount = value;
                    OnPropertyChanged(nameof(herbalTieCount));
                }
            }
        }
        /**
         * 处方金额
         */
        private decimal _presAmount;
        public decimal presAmount
        {
            get => _presAmount;
            set
            {
                if (_presAmount != value)
                {
                    _presAmount = value;
                    OnPropertyChanged(nameof(presAmount));
                }
            }
        }
        /**
         * 处方开立日期时间
         */
        private DateTime _presAt;
        public DateTime presAt
        {
            get => _presAt;
            set
            {
                if (_presAt != value)
                {
                    _presAt = value;
                    OnPropertyChanged(nameof(presAt));
                }
            }
        }
        /**
         * 处方有效标志
         */
        private string _enableFlag;
        public string enableFlag
        {
            get => _enableFlag;
            set
            {
                if (_enableFlag != value)
                {
                    _enableFlag = value;
                    OnPropertyChanged(nameof(enableFlag));
                }
            }
        }
        /**
         * 处方无效原因描述
         */
        private string _validReasonDesc;
        public string validReasonDesc
        {
            get => _validReasonDesc;
            set
            {
                if (_validReasonDesc != value)
                {
                    _validReasonDesc = value;
                    OnPropertyChanged(nameof(validReasonDesc));
                }
            }
        }
        /**
         * 执行科室标识
         */
        private string _execDeptId;
        public string execDeptId
        {
            get => _execDeptId;
            set
            {
                if (_execDeptId != value)
                {
                    _execDeptId = value;
                    OnPropertyChanged(nameof(execDeptId));
                }
            }
        }
        /**
         * 执行科室名称
         */
        private string _execDeptName;
        public string execDeptName
        {
            get => _execDeptName;
            set
            {
                if (_execDeptName != value)
                {
                    _execDeptName = value;
                    OnPropertyChanged(nameof(execDeptName));
                }
            }
        }
        /**
         * 开立医生标识
         */
        private string _prescribedDoctorId;
        public string prescribedDoctorId
        {
            get => _prescribedDoctorId;
            set
            {
                if (_prescribedDoctorId != value)
                {
                    _prescribedDoctorId = value;
                    OnPropertyChanged(nameof(prescribedDoctorId));
                }
            }
        }
        /**
         * 开立医生名称
         */
        private string _prescribedDoctorName;
        public string prescribedDoctorName
        {
            get => _prescribedDoctorName;
            set
            {
                if (_prescribedDoctorName != value)
                {
                    _prescribedDoctorName = value;
                    OnPropertyChanged(nameof(prescribedDoctorName));
                }
            }
        }
        /**
         * 开立科室标识
         */
        private string _prescribedDeptId;
        public string prescribedDeptId
        {
            get => _prescribedDeptId;
            set
            {
                if (_prescribedDeptId != value)
                {
                    _prescribedDeptId = value;
                    OnPropertyChanged(nameof(prescribedDeptId));
                }
            }
        }
        /**
         * 开立科室名称
         */
        private string _prescribedDeptName;
        public string prescribedDeptName
        {
            get => _prescribedDeptName;
            set
            {
                if (_prescribedDeptName != value)
                {
                    _prescribedDeptName = value;
                    OnPropertyChanged(nameof(prescribedDeptName));
                }
            }
        }
        /**
         * 加急标志
         */
        private string _priorityFlag;
        public string priorityFlag
        {
            get => _priorityFlag;
            set
            {
                if (_priorityFlag != value)
                {
                    _priorityFlag = value;
                    OnPropertyChanged(nameof(priorityFlag));
                }
            }
        }
        /**
         * 处方项内容类型代码
         */
        private string _presItemContentTypeCoding;
        public string presItemContentTypeCoding
        {
            get => _presItemContentTypeCoding;
            set
            {
                if (_presItemContentTypeCoding != value)
                {
                    _presItemContentTypeCoding = value;
                    OnPropertyChanged(nameof(presItemContentTypeCoding));
                }
            }
        }
        /**
         * 业务来源代码
         */
        private string _bizSourceCoding;
        public string bizSourceCoding
        {
            get => _bizSourceCoding;
            set
            {
                if (_bizSourceCoding != value)
                {
                    _bizSourceCoding = value;
                    OnPropertyChanged(nameof(bizSourceCoding));
                }
            }
        }
        /**
         * 医嘱明细列表
         */
        private List<ChargeOrderDetailVm> _orderDetailList;
        public List<ChargeOrderDetailVm> orderDetailList
        {
            get => _orderDetailList;
            set
            {
                
                if (_orderDetailList != value)
                {
                    _orderDetailList = value;
                    OnPropertyChanged(nameof(orderDetailList));
                }
            }
        }
        /**
         * 处方项列表
         */
        private List<PresItemVm> _presItemList;
        public List<PresItemVm> presItemList
        {
            get => _presItemList;
            set
            {
                if (_presItemList != value)
                {
                    _presItemList = value;
                    OnPropertyChanged(nameof(presItemList));
                }
            }
        }
        /// <summary>
        /// 处方下所有费用
        /// </summary>
        public IEnumerable<PresDetailVm> allPresDetails
        {
            get => orderDetailList.SelectMany(c => c.presDetails);
        }
    }
}
